Adaptive Control Method for Gait Detection and Classification Devices with Inertial Measurement Unit

Cueing and feedback training can be effective in maintaining or improving gait in individuals with Parkinson’s disease. We previously designed a rehabilitation assist device that can detect and classify a user’s gait at only the swing phase of the gait cycle, for the ease of data processing. In this study, we analyzed the impact of various factors in a gait detection algorithm on the gait detection and classification rate (GDCR). We collected acceleration and angular velocity data from 25 participants (1 male and 24 females with an average age of 62 ± 6 years) using our device and analyzed the data using statistical methods. Based on these results, we developed an adaptive GDCR control algorithm using several equations and functions. We tested the algorithm under various virtual exercise scenarios using two control methods, based on acceleration and angular velocity, and found that the acceleration threshold was more effective in controlling the GDCR (average Spearman correlation −0.9996, p < 0.001) than the gyroscopic threshold. Our adaptive control algorithm was more effective in maintaining the target GDCR than the other algorithms (p < 0.001) with an average error of 0.10, while other tested methods showed average errors of 0.16 and 0.28. This algorithm has good scalability and can be adapted for future gait detection and classification applications.


Research Background and Related Literatures
Parkinson's disease (PD) is a neurodegenerative disorder that is caused by a deficiency in dopamine. The main symptoms of PD can be classified as either non-motor or motor. Non-motor symptoms include things like depression and insomnia, while motor symptoms include gait disorders and freezing of gait. Music therapy [1], cueing training [2], and feedback training [3] are all methods that have been used to rehabilitate gait disorders in individuals with PD. These training methods can be effective, particularly when used in conjunction with medication or as part of a standalone rehabilitation program [4][5][6][7].
One form of rehabilitation that has been shown to be particularly effective for PDrelated gait disorders is augmented feedback training. Many researchers have explored the use of augmented feedback training to improve gait and alleviate gait disorders [8][9][10][11][12][13][14][15][16][17][18][19][20][21][22][23][24]. However, in order to effectively use these training methods, it is necessary to have a gait analysis system that can detect and evaluate a user's gait. Gait detection is important for determining whether a person is walking or not, while gait classification is necessary for evaluating the quality of the detected gait. Augmented feedback training methods rely on this information to provide appropriate feedback, such as auditory, visual, or tactile signals.
Traditionally, the gold standard for quantitative gait analysis has been optoelectronic stereophotogrammetry. However, this method requires a large laboratory and a significant budget to support its operation and maintenance [25]. An alternative to optoelectronic stereophotogrammetry is the use of inertial measurement units (IMUs). IMUs are portable and easy to use, making them a popular choice for gait analysis in both daily life and rehabilitation settings [26,27]. The use of IMUs for gait analysis is now widespread.
According to a review of wearable gait detection devices [42], 23 journal papers have used SIMUs on the shank and 25 journal papers have used SIMUs on the foot in an attempt to make SIMUs a popular wearable system for gait analysis. These papers have primarily focused on identifying a user's gait pattern using artificial intelligence (AI) and machine learning (ML) methods, such as artificial neural networks, extreme learning machines, convolutional neural networks, and long short-term memory [43][44][45][46][47], or rulebased algorithms to detect gait phases such as heel strike, toe-off, and swing phase [48][49][50][51][52].
However, the authors of this paper believed that a simpler gait analysis method was needed to use SIMUs in daily life. AI and ML require a large amount of data to set personal preferences before use, and rule-based gait phase detection algorithms are too comprehensive for our purposes. Therefore, we developed a device that detects and evaluates gait based on acceleration and angular velocity around the ankle joint at the swing phase of gait cycle [53]. This device uses a gait detection and classification (GDC) method to detect and classify a user's gait based on various factors and the GDC frequency of the device user, known as the gait detection and classification rate (GDCR). However, we found that GDCR can only be roughly controlled and it is necessary to conduct further research to develop an adaptive GDCR control method.
The development of GDCR control methods is also an invaluable part of improving the previous GDC device and method. During feedback training, the results are divided into two categories: success (positive feedback) and failure (negative feedback). Usually, the frequency of provided positive and negative feedback is closely related to the user's motivation systems in common [54][55][56][57]. Therefore, the adaptive GDCR control method is crucial for preparing for expected and unexpected events that can affect walking speed, such as medication treatment, accidental injury events, or the gradual degradation of motor control ability during rehabilitation, to maintain, enhance, or prevent the user's motivation.

Summary of the Previous Research
This research was based on previous work [53] and involved the development of a device for detecting and classifying gait based on angular velocity around the ankle joint during the swing phase of a gait cycle as shown in Figure 1. The device used modified (out of anatomical axis, i.e., directly measured by the device) the medial-lateral axis angular velocity and the magnitude of acceleration on the Sagittal plane around the ankle joint. In what remains of this article, we will loosely use the terms "angular velocity around the ankle" and "ankle acceleration" to refer to the values measured by the IMU. As shown in Figure 1, the factors changed significantly during the swing phase of the gait cycle, so we focused on this phase for gait detection and classification.
The GDC method used a gyroscopic threshold (GT) to detect the user's gait. If the z axis angular velocity of the user was recorded above the GT, the method would detect the user's gait and set a "gait detection range." The device also evaluated the user's gait based on acceleration around the ankle joint using an Acceleration Threshold (AT). If the average of the magnitude of acceleration during the gait detection range was recorded above the AT, the user's gait would be classified as a "good gait." The difference between the AT and was found to be affected by factors such as walking speed and the presence of gait disorde The GDCR was also a useful measure for observing and assessing gait conditions. Twenty-five subjects participated in the assessments of the previous experiment a we collected the acceleration and angular velocity around the ankle joint during one g cycle. Then, GDC algorithm was applied to the collected data and we observed relatio between AT, GT, walking speed, and gait symptom to GDCR. The GDCR was invers proportional to the AT, GT, and gait disorders, but directly proportional to the walki speed, as shown in Figure 3.  The case when a gait was detected and classified as a good gait (c) The case when a gait was detec but not classified as a good gait. In the previous research, the AT and GT were used to control the difficulty or ease of gait detection and classification. The GDC method and related devices were used to detect and classify the strength of a user's gait using the AT and GT as factors. Figures 1 and 2 provide more information on these definitions and how the GDC method works. The GDCR was found to be affected by factors such as walking speed and the presence of gait disorders. The GDCR was also a useful measure for observing and assessing gait conditions. GT is that the AT is based on the "average value" of data during the gait detection ran while the GT is based on the "value" of the data.
In the previous research, the AT and GT were used to control the difficulty or ease gait detection and classification. The GDC method and related devices were used to det and classify the strength of a user's gait using the AT and GT as factors. Figures 1 an provide more information on these definitions and how the GDC method works. The GD was found to be affected by factors such as walking speed and the presence of gait disorde The GDCR was also a useful measure for observing and assessing gait conditions. Twenty-five subjects participated in the assessments of the previous experiment a we collected the acceleration and angular velocity around the ankle joint during one g cycle. Then, GDC algorithm was applied to the collected data and we observed relatio between AT, GT, walking speed, and gait symptom to GDCR. The GDCR was invers proportional to the AT, GT, and gait disorders, but directly proportional to the walk speed, as shown in Figure 3.  The case when a gait was detected and classified as a good gait (c) The case when a gait was detec but not classified as a good gait. Twenty-five subjects participated in the assessments of the previous experiment and we collected the acceleration and angular velocity around the ankle joint during one gait cycle. Then, GDC algorithm was applied to the collected data and we observed relations between AT, GT, walking speed, and gait symptom to GDCR. The GDCR was inversely

Experiments for Data Collection
Experimental data were collected to develop a GDCR control algorithm and analyz gait. A device that measures acceleration and angular velocity around the ankle joint wa used to collect the data. The device was attached to a support band using a metal clip, an subjects were able to wear it themselves, although the experimenter adjusted the device for better consistency of data. Before the experiment, the devices were calibrated by hav ing subjects stand up straight for 30 s to measure acceleration in their default position. Th default position coordinate data were used to calibrate the acceleration. The collected dat were processed after the experiment and used to calculate the GDCR at different ATs an GTs. The system provided feedback at every GDC fault.
The subjects included 24 females and 1 male, with an average age of 62 years. Non of the subjects had diseases that caused gait disorders. Each subject was asked to walk fo one minute at 90 steps per minute cadence (45 times with each leg), with the experimente providing auditory metronome sounds to indicate the exact timing for walking. Subjec walked three times per each case at treadmill speeds of 1.0, 1.5, 2.0, 2.5, and 3.0 km/h Subjects took a one minute rest and then walked again, following the sequence walk-rest walk-rest-walk. If there were more data than 90 steps, only the first 90 steps were used The experimenter controlled the treadmill speed in ascending order (1 km/h-3 km/h).
The devices used were an MPU-6050 IMU sensor with an ATmega328P chip as th main control unit, and data were collected at a frequency of 30 Hz. 30 Hz was determine to prevent data shifting (phenomenon that some data was recorded at another data line and data losing (phenomenon that losing IMU data) from low data processing speed. Th accelerometers had a sensitivity of 16,384 sensor values per gravity acceleration (9.81 m per second squared (16,384 LSB/(9.81 m/s 2 )), and the gyroscope had a sensitivity of 13 sensor values per degree per second [131 LSB/(deg/s)]. Data generated by the subjects wa transmitted via a 2.4 GHz Xbee wireless communication system. Figure 4 shows an imag of the equipment and experimental setup.

Experiments for Data Collection
Experimental data were collected to develop a GDCR control algorithm and analyze gait. A device that measures acceleration and angular velocity around the ankle joint was used to collect the data. The device was attached to a support band using a metal clip, and subjects were able to wear it themselves, although the experimenter adjusted the devices for better consistency of data. Before the experiment, the devices were calibrated by having subjects stand up straight for 30 s to measure acceleration in their default position. The default position coordinate data were used to calibrate the acceleration. The collected data were processed after the experiment and used to calculate the GDCR at different ATs and GTs. The system provided feedback at every GDC fault.
The subjects included 24 females and 1 male, with an average age of 62 years. None of the subjects had diseases that caused gait disorders. Each subject was asked to walk for one minute at 90 steps per minute cadence (45 times with each leg), with the experimenter providing auditory metronome sounds to indicate the exact timing for walking. Subjects walked three times per each case at treadmill speeds of 1.0, 1.5, 2.0, 2.5, and 3.0 km/h. Subjects took a one minute rest and then walked again, following the sequence walk-rest-walk-rest-walk. If there were more data than 90 steps, only the first 90 steps were used. The experimenter controlled the treadmill speed in ascending order (1 km/h-3 km/h).
The devices used were an MPU-6050 IMU sensor with an ATmega328P chip as the main control unit, and data were collected at a frequency of 30 Hz. 30 Hz was determined to prevent data shifting (phenomenon that some data was recorded at another data line) and data losing (phenomenon that losing IMU data) from low data processing speed. The accelerometers had a sensitivity of 16,384 sensor values per gravity acceleration (9.81 m per second squared (16,384 LSB/(9.81 m/s 2 )), and the gyroscope had a sensitivity of 131 sensor values per degree per second [131 LSB/(deg/s)]. Data generated by the subjects was transmitted via a 2.4 GHz Xbee wireless communication system. Figure 4 shows an image of the equipment and experimental setup.

Impact of the AT and GT on the GDCR
IBM's SPSS software (SPSS 25) was used to perform statistical analysis to examine the impact of the walking speed, the left and right legs, and the AT and GT on the GDCR. Various statistical methods were used to determine the correlation or difference in the average between each element. Non-parametric tests, the independent sample Mann-Whitney U and Kruskal-Wallis tests, were used to assess the effect of walking speed and the left and right legs on the GDCR. Spearman's correlation analysis was used to examine the correlation between the AT, GT, and GDCR. The relation between GT and GDCR came by comparing GT and GDCR according to GT at each walking speed. For example, the GT (15,000~25,000) and GDCR (0~1) according to the GT at each walking speed (1.0 km/h~3.0 km/h) was compared. The relation between AT and GDCR came by comparing AT and GDCR according to AT at each walking speed. For example, AT (1000~15,000) and GDCR (0~1) according to the AT at each walking speed (1.0 km/h~3.0 km/h) was compared. Pearson's correlation analysis was not suitable for this analysis because the experimental dataset did not meet normality. Table 1 provides more details on the statistical analysis.
Twenty-five subjects participated in this research; however, some data on left leg and walking speed 1.0 km/h (n = 3) and 2.0 km/h (n = 1) were missed. We could compare the impact of walking speed after deleting missing data. However, we could not compute the statistical analysis for the relation between GDCR-GT and GDCR-AT since, for consistency, they can only be compared when we have data for every walking speed.
Number of subjects and samples are different, the number of samples were calculated from the number of subjects, factors, and flaws of data, and we used the number of samples as statistical analysis data. For example, the number of cases of GDCR-Leg relation was 25 on the left leg and 25 on the right leg, but data from 4 participants had flaws on left leg and walking speed 1.0 km/h (n = 3) and 2.0 km/h (n = 1). Therefore, the number of samples was 121 (cases * walking speeds-flaws, 25 × 5 − 4 = 121) on left and 125 (25 × 5 − 0 = 125) on the right leg. The dependent variable was GDCR, and the independent variable was the leg.
Also, the number of samples of the relation GDCR-walking speed was calculated as follows; the number of subjects × legs (2,

Impact of the AT and GT on the GDCR
IBM's SPSS software (SPSS 25) was used to perform statistical analysis to examine the impact of the walking speed, the left and right legs, and the AT and GT on the GDCR. Various statistical methods were used to determine the correlation or difference in the average between each element. Non-parametric tests, the independent sample Mann-Whitney U and Kruskal-Wallis tests, were used to assess the effect of walking speed and the left and right legs on the GDCR. Spearman's correlation analysis was used to examine the correlation between the AT, GT, and GDCR. The relation between GT and GDCR came by comparing GT and GDCR according to GT at each walking speed. For example, the GT (15,000~25,000) and GDCR (0~1) according to the GT at each walking speed (1.0 km/h~3.0 km/h) was compared. The relation between AT and GDCR came by comparing AT and GDCR according to AT at each walking speed. For example, AT (1000~15,000) and GDCR (0~1) according to the AT at each walking speed (1.0 km/h~3.0 km/h) was compared. Pearson's correlation analysis was not suitable for this analysis because the experimental dataset did not meet normality. Table 1 provides more details on the statistical analysis. Twenty-five subjects participated in this research; however, some data on left leg and walking speed 1.0 km/h (n = 3) and 2.0 km/h (n = 1) were missed. We could compare the impact of walking speed after deleting missing data. However, we could not compute the Sensors 2023, 23, 6638 6 of 18 statistical analysis for the relation between GDCR-GT and GDCR-AT since, for consistency, they can only be compared when we have data for every walking speed.
Number of subjects and samples are different, the number of samples were calculated from the number of subjects, factors, and flaws of data, and we used the number of samples as statistical analysis data. For example, the number of cases of GDCR-Leg relation was 25 on the left leg and 25 on the right leg, but data from 4 participants had flaws on left leg and walking speed 1.0 km/h (n = 3) and 2.0 km/h (n = 1). Therefore, the number of samples was 121 (cases * walking speeds-flaws, 25 × 5 − 4 = 121) on left and 125 (25 × 5 − 0 = 125) on the right leg. The dependent variable was GDCR, and the independent variable was the leg.
Also, the number of samples of the relation GDCR-walking speed was calculated as follows; the number of subjects × legs ( The dependent variable was GDCR, and independent variable was walking speed. The number of samples of the relation GDCR-AT was calculated as follows; the number of subjects without flaws of data × the number of AT points of the AT-GDCR curve (1901 points, from 1000 to 20,000, every 10 AT) ((25 − 4) × 1901 = 39,921). The dependent variable was GDCR, and the independent variable was AT. In the case of the relation GT-GDCR, the number of samples is calculated by the number of subjects without flaws of data − the number of GT points of the GT-GDCR curve (21 points, from 15,000 to 25,000, every 500 GT) ((25 − 4) × 21 = 441). Dependent variable was GDCR, independent variable was GT.

Algorithm
The device designed in previous research [53] and improved in this study provided GDC results for the users through various feedback types: visual, auditory, and vibration (somatosensory). The frequency of feedback given when a gait was classified as good is important for gait rehabilitation. The designed rehabilitation device provides feedback whenever a gait fails (when acceleration around the ankle joint cannot be higher than AT). Therefore, the GDCR and the frequency of the gait failure have an inverse relationship. The frequency may vary depending on the rehabilitation method or goal, but if it is too high (>30%) due to high difficulty, users may feel tired and overwhelmed by the device. On the other hand, users may feel that the rehabilitation is insufficient if the frequency is too low (<5%). Therefore, an important feature of the algorithm is its ability to maintain the GDCR, regardless of previous exercise history. Thus, an algorithm was developed that can set the GDCR to be as close as possible to the target GDCR, based on the average GDCR data from 25 subjects. The GDCR target of this algorithm was 0.9 (90% of classified gaits among detected gaits).
The relationship between the AT and the average GDCR of the experimental subjects can be represented as a sigmoid-shaped fitted curve. The function FG was calculated by multiplying the average GDCR from the experimental dataset by 1.38, as shown in Figure 5. The reason of multiplying 1.38 is that to match the range of two different functions: FG and other sigmoid shape functions. The value of 1.38 can be changed into others based on the value of the average GDCR at AT = 1000 (this can be seen in Figure 5). Therefore, the maximum value of FG was 1. In Equation (1), the maximum value of AT was 15,000, and this value was selected based on Figure 5, where it is seen that for high values of AT the GDCR approaches zero. Average GDCR at over 15,000 AT does not significantly affect GDCR. Also, AT at the equation started from 1000 for the same reason. Various sigmoid-shaped functions, such as logistic, error, algebraic, and arctangent functions, were then used to evaluate the similarity to FG. The average error and absolute value of the average differences of these functions with FG were used to determine the similarity. Equations (2)-(5) show the functions used. The average error was calculated using Equation (6). 'The number of errors' of Equation (6) was 1400, since the unit of AT was 10 (from 1000 to 15,000, every 10). Figure 6 shows the curves of the various functions and the average errors. (1) Sensors 2023, 23, x FOR PEER REVIEW 7 of 18 of errors' of Equation (6) was 1400, since the unit of AT was 10 (from 1000 to 15,000, every 10). Figure 6 shows the curves of the various functions and the average errors.   The logistic function with the least average error of 0.0131 was the function most similar to the FG among the various sigmoid-shaped functions. Therefore, the logistic function's domain range was converted into the AT domain from 1000 to 15,000 using a trendline, as shown in Equation (7). Subsequently, the function G had converted the x 1 domain, x AT based on logistic functions such as Equation (8).
To determine the features of an individual user, we developed an algorithm that personalizes the GDCR control. The algorithm is based on the average GDCR data from the 25 subjects and is designed to maintain the GDCR regardless of the user's previous exercise history. The initial personalized coefficient, C p1 , was calculated as 1.11 times the GDCR at a walking speed of 2 km/h and an AT of 6000. This value was obtained by dividing the average GDCR of experimental data at AT = 1000 by the average GDCR of experimental data at AT = 6000. Figure 5. Shape of average GDCR and FG. Solid line curve is the average GDCR from experimental dataset. Dashed line curve which has GDCR range from 0 to 1 is normalized fitted curve from average GDCR curve. Gray-colored area means the average GDCR between slowest (line below of the average GDCR, 1.0 km/h) and fastest (line above of the average GDCR, 3.0 km/h) walking speed. (1) f (x ) = Arctangent(x ) = 0.5 − 1 π arctan πx 2 (−7 < x < 5.6) (5) For values of n greater than two, C pn can be calculated using Equation (10). The personalized GDCR function, G p , can be determined by AT to predict the expected GDCR of each user, as shown in Equation (11). Equation (12) describes the normalized GDCR, G nor , which is a function derived from FG. Equation (13) describes the relationship between the AT function and the G function, and Equation (14) is the AT function that calculates the appropriate AT value to achieve the target GDCR, G target . C p 1 = average GDCR at 'AT = 1000 average GDCR at 'AT = 6000 actual GDCRat 'AT = 6000 and '2 km/h = 1.11 GDCR C p1 is the initial personalized coefficient. The average GDCR was from all of experimental subjects, and the actual GDCR would be from new experimental data that will be collected from experiments.
C p2 is the personalized coefficient to control the algorithm. 'Expected GDCR' means expected GDCR with the designed logistic function at current AT and GT. Therefore, G nor can be utilized for the purpose.
The form of G p and G nor was that of the selected sigmoid shape, the logistic function. The x domain of the logistic function changed into '0.009 × (AT − 1000)/10 − 7.009' to utilize the range of AT as a x domain of G p and G nor equations. Also, each equation was multiplied by C pn or 'average GDCR at AT = 1000' to change the range of value of the equation. AT Sensors 2023, 23, 6638 9 of 18 AT(G t ) is the inverse function of G t (AT) because G t (AT) is defined as the target GDCR according to the current value of AT and its inverted function, AT(G t ) can mean 'required AT to reach to G t '. G t can be determined from G p . This will be described when we introduce the algorithm process.
To design the GDCR adaptive control algorithm using Equation (9) from Equation (14), we followed these steps: (1) Measure C p1 at a walking speed of 2 km/h and AT = 6000; (2) Set G target to 0.9 if C p1 is greater than 0.9, or set G target to 0.01 less than C p1 if C p1 is lower than 0.9; (3) Set a new AT at AT(G target ) (initial setting end); (4) Exercise with the new AT and collect the new GDCR; (5) Calculate the new C pn ; (6) Set G target to 0.9 if C pn is greater than 0.9, or set G target to 0.01 less than C pn if C pn is lower than 0.9; and (7) Set a new AT with AT(G target ). Repeat these steps starting at step 4. Figure 7 shows the design process. AT(Gt) is the inverse function of Gt(AT) because Gt(AT) is defined as the target GDCR according to the current value of AT and its inverted function, AT(Gt) can mean 'required AT to reach to Gt'. Gt can be determined from Gp. This will be described when we introduce the algorithm process.
To design the GDCR adaptive control algorithm using Equation (9) from Equation (14), we followed these steps: (1) Measure Cp1 at a walking speed of 2 km/h and AT = 6000; (2) Set Gtarget to 0.9 if Cp1 is greater than 0.9, or set Gtarget to 0.01 less than Cp1 if Cp1 is lower than 0.9; (3) Set a new AT at AT(Gtarget) (initial setting end); (4) Exercise with the new AT and collect the new GDCR; (5) Calculate the new Cpn; (6) Set Gtarget to 0.9 if Cpn is greater than 0.9, or set Gtarget to 0.01 less than Cpn if Cpn is lower than 0.9; and (7) Set a new AT with AT(Gtarget). Repeat these steps starting at step 4. Figure 7 shows the design process. This algorithm can lead to confusion surrounding the following question: 'Will the algorithm classify the first steps as bad and then change the AT value to classify the other steps as 'good' since it is an adaptive algorithm?' However, this adaptive control algorithm is almost a daily-based algorithm. Rather than changing with every step, the idea is that over the workout of a day, for example, about 2 h of walking per day, the results are summarized to obtain an average GDCR and Cpn (as shown in Equation (10)) for the day, which is then fed into the algorithm to change for the next day's or next time's workout. In this sense, the goal of the algorithm is to keep the frequency of feedback at a similar level while increasing the difficulty so that it can be used for feedback training.
To evaluate the controllability of the adaptive control algorithm for GDCR, we designed various virtual walking-speed pattern scenarios based on experimental dataset (Walking speed-GDCR and its interpolations). These scenarios consisted of nine combinations of five walking-speed patterns: linear increase, linear decrease, random with upper and lower bounds, sudden increase, and sudden decrease, as shown in Figure 8.
The list below is description for each scenario: 1. The first scenario presents a linear increase in walking speed. 2. The second scenario presents a linear decrease in walking speed.
3. The third scenario presents walking speeds with punctuations within a range. 4. The fourth scenario presents an increasing trend in walking speed followed by a sudden decrease in the middle. This algorithm can lead to confusion surrounding the following question: 'Will the algorithm classify the first steps as bad and then change the AT value to classify the other steps as 'good' since it is an adaptive algorithm?' However, this adaptive control algorithm is almost a daily-based algorithm. Rather than changing with every step, the idea is that over the workout of a day, for example, about 2 h of walking per day, the results are summarized to obtain an average GDCR and C pn (as shown in Equation (10)) for the day, which is then fed into the algorithm to change for the next day's or next time's workout. In this sense, the goal of the algorithm is to keep the frequency of feedback at a similar level while increasing the difficulty so that it can be used for feedback training.
To evaluate the controllability of the adaptive control algorithm for GDCR, we designed various virtual walking-speed pattern scenarios based on experimental dataset (Walking speed-GDCR and its interpolations). These scenarios consisted of nine combinations of five walking-speed patterns: linear increase, linear decrease, random with upper and lower bounds, sudden increase, and sudden decrease, as shown in Figure 8.
The list below is description for each scenario: 1.
The first scenario presents a linear increase in walking speed.

2.
The second scenario presents a linear decrease in walking speed.

3.
The third scenario presents walking speeds with punctuations within a range.

4.
The fourth scenario presents an increasing trend in walking speed followed by a sudden decrease in the middle.

5.
The fifth scenario presents a decreasing trend in walking speed followed by a sudden increase in the middle.

6.
The sixth scenario presents a V-shaped trend in walking speed. 7.
The seventh scenario presents a V-shaped trend in walking speed with a range of random punctuations in the middle. 8.
The eighth scenario presents a sudden increase in ranged random punctuations after a linear decrease in walking speed. 9.
The ninth scenario presents ranged random punctuations after a linear increase in walking speed.
Also, the list below is description for algorithm processing: 1.
For an initial setting, measure the first C p1 at 2 km/h of walking speed and 6000 AT.

2.
If C p1 is recorded as smaller than 0.9, set Gt as 0.01 below C p1 (C p1 -0.01). Otherwise, if C p1 was over 0.9, set G t as 0.9.

3.
Set new AT for later rehabilitation as AT (G t ); 4.
Do exercise with set AT (G t ) and measure new GDCR as a result of exercise.
If C pn was smaller than 0.9, set Gt as 0.01 smaller than C pn (C pn − 0.01). Otherwise, if C pn was over 0.9, set Gt as 0.9. 7.
Set new AT as AT (G t ) 8.
Repeat process from 4.
The initial setting is from 1 to 3, and the adaptive control algorithm for further rehabilitation is from 4 to 8.
In addition, we prepared control methods to compare the accuracy of the adaptive control method with others;
Fixed, which simply fixes the AT at 6000; 3.
Simple, which increases or decreases the AT by 100 from the initial value of 'AT = 6000' when the GDCR exceeds 0.95 or falls below 0.9, respectively.
increase in the middle. 6. The sixth scenario presents a V-shaped trend in walking speed. 7. The seventh scenario presents a V-shaped trend in walking speed with a range of random punctuations in the middle. 8. The eighth scenario presents a sudden increase in ranged random punctuations after a linear decrease in walking speed. 9. The ninth scenario presents ranged random punctuations after a linear increase in walking speed.
Also, the list below is description for algorithm processing: 1. For an initial setting, measure the first Cp1 at 2 km/h of walking speed and 6000 AT.
2. If Cp1 is recorded as smaller than 0.9, set Gt as 0.01 below Cp1 (Cp1-0.01). Otherwise, if Cp1 was over 0.9, set Gt as 0.9. 3. Set new AT for later rehabilitation as AT(Gt); 4. Do exercise with set AT(Gt) and measure new GDCR as a result of exercise. 5. Calculate Cpn from the measured GDCR. 6. If Cpn was smaller than 0.9, set Gt as 0.01 smaller than Cpn (Cpn − 0.01). Otherwise, if Cpn was over 0.9, set Gt as 0.9. 7. Set new AT as AT(Gt) 8. Repeat process from 4.
The initial setting is from 1 to 3, and the adaptive control algorithm for further rehabilitation is from 4 to 8.
In addition, we prepared control methods to compare the accuracy of the adaptive control method with others; 1. Adaptative, designed method that was previously described; 2. Fixed, which simply fixes the AT at 6000; 3. Simple, which increases or decreases the AT by 100 from the initial value of 'AT = 6000' when the GDCR exceeds 0.95 or falls below 0.9, respectively.
These control methods were then applied to the exercise scenarios based on experimental data from subjects. This resulted in a total of 27 simulation results per subject, or 675 in total. The GDCR trends from the various scenarios and algorithms were statistically analyzed. The performance of the control methods was compared using the average error from the target GDCR to 0.9 in all scenarios. The statistical analysis included independent sample Kruskal-Wallis and Mann-Whitney U tests.  These control methods were then applied to the exercise scenarios based on experimental data from subjects. This resulted in a total of 27 simulation results per subject, or 675 in total. The GDCR trends from the various scenarios and algorithms were statistically analyzed. The performance of the control methods was compared using the average error from the target GDCR to 0.9 in all scenarios. The statistical analysis included independent sample Kruskal-Wallis and Mann-Whitney U tests.
Simulation with each scenario was ran based on the number of algorithm cycle repetition. For example, if walking speeds change from one to three, as shown in Figure 9, the algorithm measure GDCR is based on the AT(G target ) at the walking speed = 1.0 km/h. Then, the algorithm return appropriate new AT value 'AT(G target )' for the next algorithm repetition. The simulation applied new AT(G target ) to the new GDCR curve at a walking speed = 2.0 km/h and returned a new AT value. These processes repeated until simulation ended. Consequently, the average error to GDCR = 0.9 could be calculated. Simulation with each scenario was ran based on the number of algorithm cycle repetition. For example, if walking speeds change from one to three, as shown in Figure 9, the algorithm measure GDCR is based on the AT(Gtarget) at the walking speed = 1.0 km/h. Then, the algorithm return appropriate new AT value 'AT(Gtarget)' for the next algorithm repetition. The simulation applied new AT(Gtarget) to the new GDCR curve at a walking speed = 2.0 km/h and returned a new AT value. These processes repeated until simulation ended. Consequently, the average error to GDCR = 0.9 could be calculated. Figure 9. Example of virtual simulation with scenarios. If the walking speed changed from 1.0 km/h, 2.0 km/h, and to 3.0 km/h, the example simulation in scenario one will follow the sequence as shown in this figure.

Our Goal
Before presenting the results section, we would like to remind readers of what we obtained. Firstly, we calculated the average GDCR for both the left and right legs to determine whether there were any significant differences between the two. Secondly, we computed the average GDCR for different ascending walking speeds to observe the effect of walking speed on GDCR. Thirdly, we examined the impact of GT and AT on GDCR to determine which factor had a dominant effect on controlling GDCR. Finally, we investigated how the adaptive algorithm could sustain a constant GDCR as much as possible under various scenarios.

Our Goal
Before presenting the results section, we would like to remind readers of what we obtained. Firstly, we calculated the average GDCR for both the left and right legs to determine whether there were any significant differences between the two. Secondly, we computed the average GDCR for different ascending walking speeds to observe the effect of walking speed on GDCR. Thirdly, we examined the impact of GT and AT on GDCR to determine which factor had a dominant effect on controlling GDCR. Finally, we investigated how the adaptive algorithm could sustain a constant GDCR as much as possible under various scenarios.

Statistical Analysis Results of the Effects of the AT and GT on the GDCR
The statistical analysis in this section was conducted with IBM's SPSS, and the results are based on how the program works. The average GDCR on the left and right legs exhibited a non-normal distribution (p < 0.001, Kolmogorov-Smirnov test), but it differed significantly (p < 0.001, n = 246, Mann-Whitney U test). The number 246 arises from considering each leg separately, summing 121 from the left and 125 from the right leg, as shown in Table 1. Between the left and right legs, at 0.49 and 0.45, respectively. Although the samples used to examine the correlation between walking speed and GDCR, throughout entire AT range (from 1000 to 15,000), were not normally distributed (p < 0.001, Kolmogorov-Smirnov test), the average GDCRs significantly increased (p < 0.001, n = 246, Kruskal-Wallis test) with walking speeds of 0.27, 0.45, 0.49, 0.52, and 0.59, respectively; 1.0 km/h on the left leg had 47 samples (number of cases × 2 − flaws, 25 × 2 − 3 = 47); 2.0 km/h on the left leg had 49 samples (25 × 2 − 1 = 49); and others had 50 samples (25 × 2 − 0 = 50). Therefore, the sum of samples was 246. These results are shown in Figure 10.

Statistical Analysis Results of the Effects of the AT and GT on the GDCR
The statistical analysis in this section was conducted with IBM's SPSS, and the results are based on how the program works. The average GDCR on the left and right legs exhibited a non-normal distribution (p < 0.001, Kolmogorov-Smirnov test), but it differed significantly (p < 0.001, n = 246, Mann-Whitney U test). The number 246 arises from considering each leg separately, summing 121 from the left and 125 from the right leg, as shown in Table 1. Between the left and right legs, at 0.49 and 0.45, respectively. Although the samples used to examine the correlation between walking speed and GDCR, throughout entire AT range (from 1000 to 15,000), were not normally distributed (p < 0.001, Kolmogorov-Smirnov test), the average GDCRs significantly increased (p < 0.001, n = 246, Kruskal-Wallis test) with walking speeds of 0. 27  The dependent variable was GDCR for both, and independent variable were the GT and AT to calculate Spearman correlation coefficients. As a result, the GT was not a significant factor in controlling the GDCR. The Spearman correlation coefficients were −0.353, −0.210, −0.610, −0.109, and −0.056, respectively, and the walking speed were in ascending order of. GT (15,000~25,000) and GDCR according to GT (depending on walking speed) were compared. (p < 0.001, n = 441 for each walking speed as shown in Table 1, n = 2205 in sum). On the other hand, the AT was found to be a significant factor in controlling and reducing the GDCR. The Spearman correlation coefficients were −0.998 at 1 km/h and −1.000 for all other cases. AT (1000~15,000) and GDCR according to AT (depending on walking speed) were compared (p < 0.001 n = 39,921 for each walking speed as shown in Table 1, n = 199,605 in sum). The AT was the most significant factor in controlling the GDCR, and the adaptive control algorithm was designed based on the AT. Figure 11 and Figure 12 show the GDCR according to the GT and AT, respectively, and the corresponding Spearman correlation coefficients. The dependent variable was GDCR for both, and independent variable were the GT and AT to calculate Spearman correlation coefficients. As a result, the GT was not a significant factor in controlling the GDCR. The Spearman correlation coefficients were −0.353, −0.210, −0.610, −0.109, and −0.056, respectively, and the walking speed were in ascending order of. GT (15,000~25,000) and GDCR according to GT (depending on walking speed) were compared. (p < 0.001, n = 441 for each walking speed as shown in Table 1, n = 2205 in sum). On the other hand, the AT was found to be a significant factor in controlling and reducing the GDCR. The Spearman correlation coefficients were −0.998 at 1 km/h and −1.000 for all other cases. AT (1000~15,000) and GDCR according to AT (depending on walking speed) were compared (p < 0.001 n = 39,921 for each walking speed as shown in Table 1, n = 199,605 in sum). The AT was the most significant factor in controlling the GDCR, and the adaptive control algorithm was designed based on the AT. Figures 11 and 12 show the GDCR according to the GT and AT, respectively, and the corresponding Spearman correlation coefficients.

Algorithm Evaluation
In this section, the errors will not be computed from the entire range of AT but from a narrower range, dependent on the control algorithm's actual performance. The statistical analysis showed that the adaptive control method was the best among three control algorithms (n = 675, p < 0.001, Kruskal-Wallis test). Error of the result means an absolute value of 'actual GDCR-0.9.' The adaptive control method differed significantly from the others (n = 675, p < 0.001, Mann-Whitney U test). The number of samples, n, from one control method and one scenario was 25. Therefore, each control method had 225 (the number of scenarios * the number of participants, 9 × 25 = 225) samples and 675 in sum. The average errors for the adaptive, fixed, and simple control methods were 0.10, 0.16, and 0.28, respectively. Figure 13 shows the results of this analysis.

Algorithm Evaluation
In this section, the errors will not be computed from the entire range of AT but from a narrower range, dependent on the control algorithm's actual performance. The statistical analysis showed that the adaptive control method was the best among three control algorithms (n = 675, p < 0.001, Kruskal-Wallis test). Error of the result means an absolute value of 'actual GDCR-0.9.' The adaptive control method differed significantly from the others (n = 675, p < 0.001, Mann-Whitney U test). The number of samples, n, from one control method and one scenario was 25. Therefore, each control method had 225 (the number of scenarios * the number of participants, 9 × 25 = 225) samples and 675 in sum. The average errors for the adaptive, fixed, and simple control methods were 0.10, 0.16, and 0.28, respectively. Figure 13 shows the results of this analysis.
Additionally, the average errors from the experimental dataset were observed for each control method and scenario. The adaptive control method had the best performance in scenario 3, a random scenario, with an average error of 0.06. The highest error was observed in scenario 4, with an average error of 0.14. The fixed control method also had the best results in scenario 3, with the lowest average error of 0.10. The worst performance of the fixed control method was observed in scenario 4, with an average error of 0.18. The simple control method had the lowest average error in scenario 7 (0.13) and the highest average error in scenario 1 (0.66). Figure 14 shows the average errors for all the control methods. Figure 13. The average error of each control method. (n = 225; *** p < 0.001, +++ p < 0.001, vs. adaptive, ++ p < 0.01, vs. adaptive). Errors from the GDCR control algorithm came from a narrower AT range than other results, e.g., those of Figure 10.
Additionally, the average errors from the experimental dataset were observed for each control method and scenario. The adaptive control method had the best performance in scenario 3, a random scenario, with an average error of 0.06. The highest error was observed in scenario 4, with an average error of 0.14. The fixed control method also had the best results in scenario 3, with the lowest average error of 0.10. The worst performance of the fixed control method was observed in scenario 4, with an average error of 0.18. The simple control method had the lowest average error in scenario 7 (0.13) and the highest average error in scenario 1 (0.66). Figure 14 shows the average errors for all the control methods.
than other results, e.g., those of Figure 10.
Additionally, the average errors from the experimental dataset were observed for each control method and scenario. The adaptive control method had the best performance in scenario 3, a random scenario, with an average error of 0.06. The highest error was observed in scenario 4, with an average error of 0.14. The fixed control method also had the best results in scenario 3, with the lowest average error of 0.10. The worst performance of the fixed control method was observed in scenario 4, with an average error of 0.18. The simple control method had the lowest average error in scenario 7 (0.13) and the highest average error in scenario 1 (0.66). Figure 14 shows the average errors for all the control methods. Figure 14. The average error of each control method on every scenario. The N of cases was 25 per each control method in one scenario. The N of cases in one scenario was 75 in total. Errors from GDCR control algorithm came from a narrower AT range, not the full range.
The goal of the adaptive algorithm is to maintain the GDCR close to 0.9; however, why were the average GDCRs for left and right legs 0.49 and 0.45, respectively, in Figure  10? These values came from the full range of AT (from 1000 to 15,000). Therefore, as shown in Figure 12a, the GDCR curve was close to 1.0 at a lower AT and close to 0 at a higher AT. On the contrary, the errors came from algorithm usage. Therefore, errors were calculated Figure 14. The average error of each control method on every scenario. The N of cases was 25 per each control method in one scenario. The N of cases in one scenario was 75 in total. Errors from GDCR control algorithm came from a narrower AT range, not the full range.
The goal of the adaptive algorithm is to maintain the GDCR close to 0.9; however, why were the average GDCRs for left and right legs 0.49 and 0.45, respectively, in Figure 10? These values came from the full range of AT (from 1000 to 15,000). Therefore, as shown in Figure 12a, the GDCR curve was close to 1.0 at a lower AT and close to 0 at a higher AT. On the contrary, the errors came from algorithm usage. Therefore, errors were calculated from the algorithm control results; consequently, GDCR was usually higher than 0.5 since the control algorithm was designed to sustain GDCR close to 0.9. In short, the GDCRs equal to 0.49 and 0.45 from each leg were from the entire AT range (from 1000 to 15,000), while errors from the GDCR control algorithm came from a narrower AT range.

Discussion and Conclusions
This study investigated the correlations between the GDCR and various elements used in GDC devices and developed an adaptive GDCR control algorithm to control the GDCR and feedback frequency during exercise using a set AT. The adaptive control algorithm improves the user experience by reducing mental fatigue associated with a higher feedback generation frequency and addresses user uncertainty about the feedback and the functionality of the device when the GDCR is high. However, some readers may still have some confusion from our research. To add more description for better understanding and to avoid confusion, we ask: why the 'Steady walking speed scenario was not included into virtual scenarios?' We did not need to include a scenario with constant walking speed. The main purpose of the designed algorithm is to observe how the algorithm can compensate fluctuating GDCR from different walking conditions. At the constant walking speed scenario (1.5 km/h), we expected the AT and GDCR to be invariant with a constant walking speed, and this is actually right. Moreover, we assumed that daily walking speeds would be subtly different in a real-world rehabilitation scenario, so the constant walking speed scenario was altered by including a randomized scenario, i.e., scenario 3.
Previous studies have collected and classified gait factors for diagnosing and rehabilitating patients with Parkinson's disease, stroke, and other conditions [58][59][60][61][62][63]. Further experiments are needed to determine the effectiveness of the device developed in this study in improving gait symptoms. Other researchers have used IMU systems to quantitatively assess gait [64][65][66][67]. AI has also been applied to assess, evaluate, and extract gait features using IMU systems [43][44][45][46][47]. To the best of our knowledge, there has not been any similar research using an extremely simplified gait detection and assessment system with an associated control algorithm. The device developed in this study uses only one element, AT, to control the GDCR, and does not employ any machine learning methods or AI systems for gait analysis. Therefore, the GDC device and its adaptive control algorithm can roughly but easily detect changes in the user's condition.
The developed algorithm has good scalability because it uses acceleration around the ankle joint, which can be measured by various devices. For example, the gait rehabilitation algorithm can be used with inertial motion capture systems commonly used in virtual reality production, allowing patients to rehabilitate in a virtual reality environment using a treadmill. The algorithm also has a simple design, making it reproducible and repairable. The device is lightweight, small, and wearable, and can be attached to an ankle brace or another support for ease of use. However, the device already adopted some components to generate a feedback signal needed to be advances. Therefore, additional advanced components such as better and smaller speakers for auditory feedback or lasers for visual feedback can be added to enhance the user experience and portability.
The results of this study confirmed the validity of the existing GDC algorithm after the statistical analysis of the research data. The device and algorithm in this study were designed based on this analysis. Further research is needed to confirm the medical effectiveness of the device and algorithm and to determine their potential for use in clinical settings. In conclusion, the GDC device and adaptive control algorithm developed in this study can provide a rough but easy detection of changes in the user's condition and have the potential to improve gait symptoms and enhance the user experience.  Institutional Review Board Statement: Ethical review and approval were waived for this study because it belongs to the first class of the Korean medical device classification criteria, and the experiment was conducted with the consent of the subjects for research purposes, not commercial purposes.
Informed Consent Statement: Informed consent was obtained from all subjects involved in the study. Written informed consent has been obtained from the patients to publish this paper.